package com.stellar.core.code;

import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author Jqcc
 * @version 1.0
 * @date 2025/2/13
 */
@Data
public class VerifyCode {

    /**
     * 验证码内容
     */
    private String code;

    /**
     * 验证码过期时间
     */
    private LocalDateTime expireTime;

    public VerifyCode(String code, int expireInSeconds) {
        this.code = code;
        this.expireTime = LocalDateTime.now().plusSeconds(expireInSeconds);
    }

    public boolean isExpired() {
        return LocalDateTime.now().isAfter(expireTime);
    }
}